package com.wali.modules.system.bo;

import com.wali.modules.system.vo.SysUserVO;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author walixu
 * @ClassName com.wali.modules.system.bo
 * @Description 用户BO类
 * @email wali.xu@kpmg.com
 * @date 12/1/2019 7:39 下午
 */
public class SysUserBO implements Serializable {

    /**
     * 编号
     */
    private int id;

    /**
     * 用户名
     */
    private String username;

    /**
     * 密码
     */
    private String password;

    /**
     * 确认密码
     */
    private String confirmPassword;

    /**
     * 创建日期
     */
    private String createDate;

    /**
     * 更新日期
     */
    private String updateDate;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getConfirmPassword() {
        return confirmPassword;
    }

    public void setConfirmPassword(String confirmPassword) {
        this.confirmPassword = confirmPassword;
    }

    public String getCreateDate() {
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public String getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(String updateDate) {
        this.updateDate = updateDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SysUserBO sysUserBO = (SysUserBO) o;
        return id == sysUserBO.id &&
                Objects.equals(username, sysUserBO.username) &&
                Objects.equals(password, sysUserBO.password) &&
                Objects.equals(confirmPassword, sysUserBO.confirmPassword) &&
                Objects.equals(createDate, sysUserBO.createDate) &&
                Objects.equals(updateDate, sysUserBO.updateDate);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, username, password, confirmPassword, createDate, updateDate);
    }

    @Override
    public String toString() {
        return "SysUserBO{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", confirmPassword='" + confirmPassword + '\'' +
                ", createDate='" + createDate + '\'' +
                ", updateDate='" + updateDate + '\'' +
                '}';
    }

    /**
     * @param SysUserBO
     * @return SysUserVO
     * @throws
     * @Title convert
     * @Description 将SysUserBO转化为SysUserVO
     */
    public static SysUserVO convert(SysUserBO sysUser) {
        SysUserVO temp = new SysUserVO();
        temp.setId(sysUser.getId());
        temp.setUsername(sysUser.getUsername());
        temp.setPassword(sysUser.getPassword());
        return temp;
    }
}
